#!/bin/sh

set -e

HOST_MULTIARCH=`dpkg-architecture -qDEB_HOST_MULTIARCH`

if [ remove = "$1" -o abort-install = "$1" -o disappear = "$1" ];
then
	dpkg-divert --package libjpeg-turbo-progs --rename \
		--remove /usr/share/man/man1/wrjpgcom.1.gz 
	dpkg-divert --package libjpeg-turbo-progs --rename \
		--remove /usr/share/man/man1/cjpeg.1.gz 
	dpkg-divert --package libjpeg-turbo-progs --rename \
		--remove /usr/share/man/man1/djpeg.1.gz 
	dpkg-divert --package libjpeg-turbo-progs --rename \
		--remove /usr/share/man/man1/rdjpgcom.1.gz
	dpkg-divert --package libjpeg-turbo-progs --rename \
		--remove /usr/share/man/man1/jpegtran.1.gz
	rmdir /usr/share/man/libjpeg-progs-divert
	dpkg-divert --package libjpeg-turbo-progs --rename \
		--remove /usr/bin/rdjpgcom
	dpkg-divert --package libjpeg-turbo-progs --rename \
		--remove /usr/bin/wrjpgcom
	dpkg-divert --package libjpeg-turbo-progs --rename \
		--remove /usr/bin/jpegtran
	dpkg-divert --package libjpeg-turbo-progs --rename \
		--remove /usr/bin/cjpeg
	dpkg-divert --package libjpeg-turbo-progs --rename \
		--remove /usr/bin/djpeg
	rmdir /usr/bin/libjpeg-progs-divert
fi

#DEBHELPER#
